package com.example.yangxu0703.thundermapclient.thread;

import java.io.File;
import java.util.ArrayList;

public class FileDeleteThread extends Thread {

    public ArrayList<String> deleteList;
    public FinishCallback callback;

    public void setFinishCallback(FinishCallback callback){
        this.callback=callback;
    }

    public FileDeleteThread(ArrayList<String> deleteList) {
        this.deleteList = deleteList;
    }


    @Override
    public void run() {
        super.run();
        for (String path:deleteList){
            File file =new File(path);
            if (file.exists()){
                file.delete();
            }
        }
        callback.finishback(true);
    }

    public interface  FinishCallback{
        void  finishback(boolean status);
    }

}
